#include <iostream>

using namespace std;

class Solution
{
public:
    int mySqrt(int x)
    {
        if (x == 0)

            return 0;

        double x0 = x;
        while (true)
        {
            double newX0 = (x0 + x / x0) / 2;
            cout << newX0 << endl;
            if (fabs(x0 - newX0) < 1e-7)
                break;
            x0 = newX0;
        }
        return int(x0);
    }
};

int main()
{
    cout << "Code69" << endl;
    Solution s;
    cout << s.mySqrt(2147395599);
    // 46339
    return 0;
}